package com.lbd.system.service.impl;

import com.lbd.system.bean.SystemProperty;
import com.lbd.system.dao.SystemPropertyRepository;
import com.lbd.system.service.SystemPropertyService;
import com.lbd.base.service.BaseServiceImpl;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;


@Service
@Transactional
public class SystemPropertyServiceImpl extends BaseServiceImpl<SystemProperty, SystemPropertyRepository> implements SystemPropertyService {
    private final Logger log = Logger.getLogger(this.getClass());
    @Autowired
    SystemPropertyRepository systempropertyRepository;

    @Override
    public Specification<SystemProperty> getSpecification(SystemProperty systemproperty) {
        return null;
    }

    /**
     * 构建查询语句和参数
     *
     * @param systemproperty
     * @param parameter
     * @return
     */
    @Override
    public String buildJpql(SystemProperty systemproperty, Map<String, Object> parameter) {
        StringBuilder jpqlBuilder = new StringBuilder("  from  SystemProperty t   ");
        if (systemproperty != null) {

        }
        jpqlBuilder.append(" order by createdDate desc ");
        return jpqlBuilder.toString();
    }


    @Override
    public SystemProperty findById(String id) {
        return systempropertyRepository.findOne(id);
    }
}
